home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Funcion STRCMP no lexicographical
- Date: 30 Jan 1996 07:22:15 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4eld37INNbt4@keats.ugrad.cs.ubc.ca>
- References: <4e8e3h$k0s@serra.unipi.it>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4e8e3h$k0s@serra.unipi.it>,
- Luca Fiorani <fioranil@ilc.pi.cnr.it> wrote:
- >Developing GCC/G++ programs under sparc-sun-sunOS4.1.3 , i need simply to
- >compare arrays that may include characters>127(dec.).
- >STRCMP or MEMCMP do this lexicographically, that is what i don't want to do.
- >Are there other functions that compares 2 arrays NOT lexicografically ?
- >(the matter is that lexicographically chars>127 are BEFORE chars<=127)
-
- I'm not sure what you mean by "lexicographic". It seems to be a consequence of
- using signed comparisons on eight-bit quantities. Lexicographic doesn't
- necessarily mean "ordered by ASCII codes".
-
- Rewrite strcmp() so that it uses unsigned arithmetic.
- --
-
-